package com.itheima.api.client;

import com.itheima.api.client.dto.CategoryDto;
import com.itheima.api.client.dto.TagDto;
import com.itheima.api.client.fallback.AdminClientFallbackFactory;
import com.itheima.common.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "blog-admin",
        configuration = FeignClientConfig.class,
        fallbackFactory = AdminClientFallbackFactory.class)
public interface AdminClient {

    @PostMapping("/tag/getList")
     List<TagDto> getTagList();

    @PostMapping("/tag/listWithIds")
     List<TagDto> listWithIds(@RequestParam List<Integer> tagIds);

    @PostMapping("/category/getCategoryList")
    public List<CategoryDto> getCategoryList();

    @PostMapping("/category/getIdByName")
    public CategoryDto getCategoryByName(@RequestParam String categoryName);
    @PostMapping("/tag/getIdByName")
    public TagDto getTagByName(@RequestParam String tagName);

    //轮播图fein接口
    @GetMapping("/banner/list")
    R<List> getBannerList();

    @PostMapping("/category/getCategoryList")
    public List<CategoryDto> getCategoryList();

    @PostMapping("/category/getIdByName")
    public CategoryDto getCategoryByName(@RequestParam String categoryName);
    @PostMapping("/tag/getIdByName")
    public TagDto getTagByName(@RequestParam String tagName);

}
